<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script src="../day8/js/ajax.js"></script>
    <script>
        function reText(url) {
            return new Promise(function (resolve,) {
                ajax({
                    url: url,
                    // dataType: "json",
                    success: function (txt) {
                        console.log(txt);
                        resolve(txt)

                    }
                })


            })
        }
        var p = reText("../day8/data/1.txt");
        console.log("p", p);
        var p1 = p.then(function (txt) {
            console.log("p", txt);
            return 1;
        })
        console.log("p1", p1);
        var p2 = p1.then(function (val) {
            console.log("p1", val);
            return 2;
        })
        console.log("p2", p2);

    </script>
</body>

</html>